using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;

namespace WsdlStudioLibrary.Windows.Controls.GotDotNetWebServiceStudioGui
{


    internal enum RequestMethod
    {
        GET ,
        POST 
        //, SOAP11 ,
        //SOAP12 ,
        //WSE
    }

    /// <summary>
    // Customer class to be displayed in the property grid
    /// </summary>
    /// 
    [DefaultPropertyAttribute("Name")]
    internal class RequestProperties
    {
        private string _RequestProperties;
        private bool _AllowAutoRedirect = true;
        private bool _AllowWriteStreamBuffering = true;
        private string _BasicAuthPassword;
        private string _BasicAuthUserName;
        private string _ContentType;
        private string _HttpProxy;
        private bool _KeepAlive= true;
        private RequestMethod _Method = RequestMethod.GET ;
        private bool _Pipelined = false ;
        private bool _PreAutheticate = false ;
        private bool _SendCunked = false ;
        private string _SOAPAction;
        private int _Timeout = 10000;
        private string _Url;
        private bool _UseCookieContainer = false ;
        private bool _UseDefaultCredentials = false ;

        // Name property with category attribute and 
        // description attribute added 
        #region __RequestProperties__
		[CategoryAttribute("Design"), DescriptionAttribute("Request Properties Title")]
        public string __RequestProperties__
        {
             
            get
            {
                return _RequestProperties;
            }
        } 
	    #endregion

        #region AllowAutoRedirect
		[CategoryAttribute("Design"),
        DescriptionAttribute("Allow Auto Redirect: True / False")]
        public bool AllowAutoRedirect
        {
            get
            {
                return _AllowAutoRedirect;
            }
            set
            {
                _AllowAutoRedirect = value;
            }
        } 
	    #endregion

        #region AllowWriteStreamBuffering
		[CategoryAttribute("Design"),
        DescriptionAttribute("Allow Write Stream Buffering: True / False")]
        public bool AllowWriteStreamBuffering
        {
            get
            {
                return _AllowWriteStreamBuffering;
            }
            set
            {
                _AllowWriteStreamBuffering = value;
            }
        } 
	    #endregion

        #region BasicAuthPassword
		[CategoryAttribute("Security"),
        DescriptionAttribute("Basic Authentication Password (optional)")]
        public string BasicAuthPassword
        {
            get
            {
                return _BasicAuthPassword;
            }
            set
            {
                _BasicAuthPassword = value;
            }
        }
 	    #endregion

        #region BasicAuthUserName
		[CategoryAttribute("Security"), 
        DescriptionAttribute("Basic Authentication Username (optional)")]
        public string BasicAuthUserName
        {
            get
            {
                return _BasicAuthUserName;
            }
            set
            {
                _BasicAuthUserName = value;
            }
        } 
	    #endregion

        #region ContentType
		[CategoryAttribute("HTTP"),
        DescriptionAttribute("ContentType")]
        public string ContentType
        {
            get
            {
                return _ContentType;
            }
            set
            {
                _ContentType = value;
            }
        } 
	    #endregion

        #region HttpProxy
        [CategoryAttribute("HTTP"),
        DescriptionAttribute("Http Proxy URL")]
        public string HttpProxy
        {
            get
            {
                return _HttpProxy;
            }
            set
            {
                if (_HttpProxy.IndexOf("http://") < 0)
                    _HttpProxy = "http://" + _HttpProxy + "/";

                _HttpProxy = value;
            }
        } 
        #endregion

        #region KeepAlive
        [CategoryAttribute("HTTP"),
        DescriptionAttribute("Http Proxy URL")]
        public bool KeepAlive
        {
            get
            {
                return _KeepAlive;
            }
            set
            {
                _KeepAlive = value;
            }
        }
        #endregion

        #region Method
        [CategoryAttribute("HTTP"),
        DescriptionAttribute("Http Proxy URL")]
        public RequestMethod Method
        {
            get
            {
                return _Method;
            }
            set
            {
                _Method = value;
            }
        }
        #endregion

        #region Pipelined
        [CategoryAttribute("HTTP"),
        DescriptionAttribute("Pipelined")]
        public bool Pipelined
        {
            get
            {
                return _Pipelined;
            }
            set
            {
                _Pipelined = value;
            }
        }
        #endregion

        #region PreAutheticate
        [CategoryAttribute("HTTP"),
        DescriptionAttribute("PreAutheticate")]
        public bool PreAutheticate
        {
            get
            {
                return _PreAutheticate;
            }
            set
            {
                _PreAutheticate = value;
            }
        }
        #endregion

        #region SendCunked
        [CategoryAttribute("HTTP"),
        DescriptionAttribute("SendCunked")]
        public bool SendCunked
        {
            get
            {
                return _SendCunked;
            }
            set
            {
                _SendCunked = value;
            }
        }
        #endregion

        #region SOAPAction
        [CategoryAttribute("SOAP"),
        DescriptionAttribute("SOAPAction")]
        public string SOAPAction
        {
            get
            {
                return _SOAPAction;
            }
            set
            {
                _SOAPAction = value;
            }
        }
        #endregion

        #region Timeout
        [CategoryAttribute("HTTP"),
        DescriptionAttribute("Timeout")]
        public int Timeout
        {
            get
            {
                return _Timeout;
            }
            set
            {
                _Timeout = value;
            }
        }
        #endregion

        #region Url
        [CategoryAttribute("HTTP"),
        DescriptionAttribute("Url")]
        public string Url
        {
            get
            {
                return _Url;
            }
            set
            {
                _Url = value;
            }
        }
        #endregion

        #region UseCookieContainer
        [CategoryAttribute("HTTP"),
        DescriptionAttribute("Use Cookie Container")]
        public bool UseCookieContainer
        {
            get
            {
                return _UseCookieContainer;
            }
            set
            {
                _UseCookieContainer = value;
            }
        }
        #endregion

        #region UseDefaultCredentials
        [CategoryAttribute("HTTP"),
        DescriptionAttribute("Use Default Credentials")]
        public bool UseDefaultCredentials
        {
            get
            {
                return _UseDefaultCredentials;
            }
            set
            {
                _UseDefaultCredentials = value;
            }
        }
        #endregion
 
        public RequestProperties()
        {
        }
    } 
}
